import { METHOD, request } from '@/utils/request'

const API_PROXY_PREFIX = '/api/services/app/'
const BASE_URL = process.env.VUE_APP_API_BASE_URL + API_PROXY_PREFIX

export async function get(params, control) {
    return request(BASE_URL + control + '/Get', METHOD.GET, params)
}
export async function getAll(params, control) {
    return request(BASE_URL + control + '/GetAll', METHOD.GET, params)
}
export async function create(params, control) {
    return request(BASE_URL + control + '/Create', METHOD.POST, params)
}
export async function del(params, control) {
    return request(BASE_URL + control + '/Delete', METHOD.GET, params)
}
export async function update(params, control) {
    return request(BASE_URL + control + '/Update', METHOD.PUT, params)
}

export default { get, getAll, create, update, del }